
package com.sx.core.page;

import org.springframework.core.convert.converter.Converter;

import java.util.List;


/**
 * TODO: DOCUMENT ME!
 *
 * @author   <a href="mailto:lihao@ozstrategy.com">Hao Li</a>
 * @version  03/27/2017 17:05
 */
public interface Slice<T> extends Iterable<T> {
  //~ Methods ----------------------------------------------------------------------------------------------------------

  /**
   * getter method for content.
   *
   * @return  List
   */
  List<T> getContent();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for number.
   *
   * @return  int
   */
  int getNumber();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for number of elements.
   *
   * @return  int
   */
  int getNumberOfElements();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for size.
   *
   * @return  int
   */
  int getSize();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for sort.
   *
   * @return  Sort
   */
  Sort getSort();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * hasContent.
   *
   * @return  boolean
   */
  boolean hasContent();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * hasNext.
   *
   * @return  boolean
   */
  boolean hasNext();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * hasPrevious.
   *
   * @return  boolean
   */
  boolean hasPrevious();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for first.
   *
   * @return  boolean
   */
  boolean isFirst();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * getter method for last.
   *
   * @return  boolean
   */
  boolean isLast();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * map.
   *
   * @param   <S>        Converter
   * @param   converter  Converter
   *
   * @return  Slice
   */
  <S> Slice<S> map(Converter<? super T, ? extends S> converter);

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * nextPageable.
   *
   * @return  Pageable
   */
  Pageable nextPageable();

  //~ ------------------------------------------------------------------------------------------------------------------

  /**
   * previousPageable.
   *
   * @return  Pageable
   */
  Pageable previousPageable();
} // end interface Slice
